Repository navigation
Conversation
- 新增根 ruff.toml,与 AUTO-MAS 主仓同口径(E4/E7/E9/F/I,不引入风格类规则) - 新增 .github/workflows/python-check.yml:lint 作业跑 ruff check 与 ruff format --check; pytest 作业稀疏检出 AUTO-MAS 主仓 dev 分支作为宿主,再跑本仓 tests - tests/conftest.py 支持 AUTO_MAS_ROOT 定位宿主源码,缺 SDK 时在报告头给出提示 - 新增 tests/README.md,写明为什么要准备主仓、本地跑法与稀疏检出命令 - 按 ruff 修正 5 处导入排序与 2 处行宽
新增「开发」小节,把静态检查与测试的入口指向 tests/README.md, 避免第一次 clone 下来的人先去撞 ModuleNotFoundError。
总体结论:可以合并测试直接用 AUTO-MAS 的真实 SDK,不用在 SignFlow 里再养一套桩,这个取舍合适。先把 Windows 跑通就够了,不用为了凑矩阵先挂一个没验证过的 Linux 测试作业。 文档有个小地方可以顺手补:新克隆宿主的步骤只到稀疏检出,照着回到上面执行时 测试用真 SDK,文档再补上建环境那一步就齐了。dot酱 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
摘要
ruff.toml,检查口径与 AUTO-MAS 主仓一致(E4/E7/E9/F/I),并修掉由此暴露的 5 处导入排序与 2 处行宽问题.github/workflows/python-check.yml:lint作业跑ruff check与ruff format --check;pytest作业先稀疏检出 AUTO-MAS 主仓当宿主,再跑本仓全部测试tests/conftest.py支持用AUTO_MAS_ROOT定位宿主源码,缺 SDK 时把补法写进测试报告头tests/README.md,说明为什么必须先准备主仓、本地怎么跑、没有主仓时怎么稀疏检出测试与验证
自动化测试
CI 链路本地实跑
按 workflow 里 pytest 作业的步骤在本机完整走了一遍,确认命令形态成立:
git clone --depth=1 --filter=blob:none --sparse --branch devgit sparse-checkout set app plugins/auto_mas_coreapp/config/__init__.py、plugins/auto_mas_core/src/auto_mas_core/__init__.py、pyproject.toml、uv.lockuv sync --locked --group dev --project <host>uv run --project <host> --no-sync python -m pytest tests -q为什么 pytest 作业只挂 Windows
auto_mas_core在模块级依赖主仓的app.*,而宿主app/utils里有 26 处缩进为 0 的win32*导入(集中在app/utils/windows/**)。本机没有 WSL 也没有容器,无法验证这些导入在 ubuntu runner 上是否会被触发,所以首个 PR 先只保证一条能跑绿的基线;Linux 待单独评估后再加进矩阵,不在这一个 PR 里赌。为什么用稀疏检出而不是桩
packages/里共有 14 条模块级auto_mas_core导入,覆盖ExtensionPlugin、ConfigGroup、PluginConfig、ui、encrypted、UiVisibility、OutBase、get_logger、UTC8、PLUGIN_API_VERSION,测试本身还要Plugin与PluginError。写一套桩等于把 SDK 的行为重新猜一遍,假实现一跑偏,测试就失去意义。稀疏检出只多 10 MB 和约 75 秒,换来「测的是真 SDK」。也试过「只补第三方依赖」:空环境先缺
loguru,补齐 15 个轻量包后又缺yaml,实际要凑齐主仓 39 个生产依赖(含maafw、rapidocr_onnxruntime、opencv-python),不可行。未覆盖范围
auto-mas-core与四个包的发布状态不受本 PR 影响Closes #1